package org.agile2soft.nexoma.tapestry.pages;

import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.PageRenderLinkSource;
import org.slf4j.Logger;

/**
 * Start page of application geloa2.
 */
public class Logout
{
	
	@Inject
	private PageRenderLinkSource _pageRenderLinkSource;
	
	@Inject
	private Logger logger;
	
	@InjectPage
	private Portal portalPage;
	
	@OnEvent(value=EventConstants.ACTIVATE)
	Object doGoHome() {
		logger.info("Activate.doGoHome() -> " + _pageRenderLinkSource.createPageRenderLinkWithContext(Portal.class, "logout").toAbsoluteURI());
		portalPage.setMessageCode("logout");
		return portalPage;
	}

}
